今天進度 : 鳥哥的 Linux 私房菜 -- 第 10 堂課:使用者管理與 ACL 權限設定
嘗試建立新的使用者
test@test:~$ sudo -s
[sudo] password for test:
root@test:/home/test# useradd demouser
root@test:/home/test# passwd demouser
New password:
Retype new password:
passwd: password updated successfully
查看新的使用者資料
root@test:/home/test# id demouser
uid=1001(demouser) gid=1001(demouser) groups=1001(demouser)
root@test:/home/test# grep demouser /etc/passwd /etc/group /etc/shadow
/etc/passwd:demouser:x:1001:1001::/home/demouser:/bin/sh
/etc/group:demouser:x:1001:
/etc/shadow:demouser:$6$vU7PwJImn742x.dy$D5km.S7cFIMZ/OpdAWoMZk2mRXpvayYE7FLXyT66jmOsu7ZYy56/fEbaDI7.AXRFzEPHLx2dwU/3IcVUi.dW2/:18565:0:99999:7:::
跟我預設管理員帳號比較
test@test:~$ id test
uid=1000(test) gid=1000(test) groups=1000(test),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),116(lxd)
root@test:/home/test# grep test /etc/passwd /etc/group /etc/shadow
/etc/passwd:test:x:1000:1000:test:/home/test:/bin/bash
/etc/group:adm:x:4:syslog,test
/etc/group:cdrom:x:24:test
/etc/group:sudo:x:27:test
/etc/group:dip:x:30:test
/etc/group:plugdev:x:46:test
/etc/group:lxd:x:116:test
/etc/group:test:x:1000:
/etc/shadow:test:$6$viiMRd9k72QyaJa6$NN7poqUyaIdsaiH8vqLwRcCcNDA3lFLBs/XeLJ0uBIuuFmENDJ6LYj.xE6ZoQxxIj1lrC63flHK3Jv2d91fNY1:18561:0:99999:7:::
test@test:~$ id root
uid=0(root) gid=0(root) groups=0(root)
root@test:/home/test# grep root /etc/passwd /etc/group /etc/shadow
/etc/passwd:root:x:0:0:root:/root:/bin/bash
/etc/group:root:x:0:
/etc/shadow:root:*:18474:0:99999:7:::